﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Security.Principal;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Web.Security;
using System.Web.UI;
using Ashlen.Portal.Core;
using Ashlen.Portal.Core.DataInterfaces;
using Ashlen.Portal.Data.SqlServer;
using System.Web;

namespace Ashlen.Portal.Controllers
{
    [HandleError]
    [OutputCache(Location = OutputCacheLocation.None)]
    public class NewsController : Controller
    {
        public NewsController()
        {

        }

        public ActionResult Wall(string textBox1)
        {
            ViewData["Title"] = Ashlen.Portal.Data.SqlServer.UtilityDao.Instance.GetConfig(Ashlen.Portal.Data.SqlServer.Constants.APPLICATION, "ApplicationName") + " - News Page";
            if (Request.HttpMethod == "GET")
            {
                return View("Wall");
            }
            //else
            //{
            //    if (Request.IsMvcAjaxRequest()) {
            //        // Do AJAX bit here 
            //        System.Threading.Thread.Sleep(8000);
            //        return Json(new AjaxResponse(){Response = ResponseCode.Error, Body = "Hello"});
            //        //return Json("hi " + textBox1);
            //    }
            //    else
            //    {
            //        ViewData["username"] = textBox1;
            //        ViewData["message"] = string.Format("Hi {0}!", textBox1);
            //    }
            //}

            return View("Wall");
        }
    }
}
